<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.hz.data.Export"%>
<%@ page import="com.jspsmart.upload.*" %>
<%@page import="com.hz.model.User"%>


<%
    Collection<User> ulist = (Collection<User>)session.getAttribute("ulist");
	String path = request.getRealPath("/");
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/";
	String fileName = System.currentTimeMillis() + ".xls";
	String realPath = path + "\\DownloadXls\\" + fileName;
	String visitPath = basePath + "/DownloadXls/" + fileName;
	Export.ExportUsers(realPath,ulist);
	
	SmartUpload smartUpload = new SmartUpload();
	smartUpload.initialize(pageContext);
	smartUpload.setContentDisposition(null);
	smartUpload.downloadFile(realPath);
	out.clear();
 	out=pageContext.pushBody();
 	session.removeAttribute("ulist");
%>
